package com.handydata.antifraud.vo.riskres;

import java.io.Serializable;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;

import lombok.Data;

import com.bstek.urule.model.Label;
import com.handydata.common.util.JSONUtil;

@Data
public class RiskOutputVO  implements Serializable {

	private static final long serialVersionUID = 4553149502142417956L;
	
	private String orderId;
    /**高危职业*/
    private String riskJob;

    /**黑名单*/
    private String telBlackList;

    /**是否gps距离过远*/
    private String gpsDistance;

    /**手机号码归属地省份*/
    private String telProvince;

    /**手机号码归属地城市*/
    private String telCity;

    /**gps省份*/
    private String gpsProvince;

    /**gps城市*/
    private String gpsCity;

    /**是否准入城市*/
    private String isPlaceAllowed;

    /**社交异常关联挖掘*/
    private String socialInfo;

    /**社交异常关联挖掘*/
    private String socialAssociate;

    /**设备关联异常检测*/
    private String deviceAssociate;

    private String isEduLevelChecked="-1";

    /**网络环境异常评估*/
    private String networkEnv;

    /**AP自画像*/
    private String appSelfPortrait;

    /**APP异常评估*/
    private String appAbnormal;

    /**GhostTyping*/
    private String inputBehavior;

    /**地理集中反中介模型*/
    private String placeFocus;

    /**地理稳定性评估*/
    private String placeStable;

    /**模拟器识别*/
    private String simulatorIdentify;

    /**社保缴纳评估*/
    private String info1;

    /**最近社保实际缴费基数*/
    private String info2;

    /**额度加分项数*/
    private String info3;

    /**行业额度系数*/
    private String info4;

    /**三方数据黑名单*/
    private String info5="0";

    /**三方数据多头*/
    private String info6="0";

    /**三方数据评分*/
    private String info7="0";
    
    /** 是否具有个税 */
    private String info8="2";
    
    @Label("订单数大于500")
    private String info9 = "0";

    /**反欺诈分*/
    private Integer riskScore;
    
    /* 2020-06-11 add */
	private String value1;// 阿里云申请反欺诈分 （antiFraudScore）
	private String value2;// 行列秩评分1（hlzBin13Score）
	private String value3;// 阿福中额版评分（afMidscore）
	private String value4;// 信易搜明眸分（xysSmallMultiScore）
	private String value5;// 腾讯消费分期（txFraudRiskScore）
	private String value6;// 华道综合信用分（hdCreditscore）
	private String value7;// 近12个月网贷注册信息权重（hdDt01005）
	private String value8;// 近5个月网贷消费分期信息权重（hdDt01002）
	private String value9;
	private String value10;
	private String value11;
	private String value12;
	private String value13;
	private String value14;
	private String value15;
	private String value16;
	private String value17;
	private String value18;
	private String value19;
	private String value20;
	private String value21;
	private String value22;
	private String value23;
	private String value24;
	private String value25;
	private String value26;
	private String value27;
	private String value28;
	private String value29;
	private String value30;

    public String getJSONString() {
        Map<String, Object> map = new HashMap<>();
        map.put("orderId", orderId);
        //map.put("dateTime", DateUtil.now18());

        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss:SSS");
        Date date = new Date();
        String dateStr = sdf.format(date);
        map.put("dateTime", dateStr);
        map.put("riskScore", riskScore);

        Map<String, String> entryRules = new HashMap<>();
        entryRules.put("riskJob", riskJob);
        entryRules.put("telBlackList", telBlackList);
        entryRules.put("gpsDistance", gpsDistance);
        entryRules.put("telProvince", telProvince);
        entryRules.put("telCity", telCity);

        entryRules.put("gpsProvince", gpsProvince);
        entryRules.put("gpsCity", gpsCity);
        entryRules.put("isPlaceAllowed", isPlaceAllowed);
        entryRules.put("isEduLevelChecked", isEduLevelChecked);

        Map<String, String> riskDetail = new HashMap<>();
        riskDetail.put("socialInfo", socialInfo);
        riskDetail.put("socialAssociate", socialAssociate);
        riskDetail.put("deviceAssociate", deviceAssociate);
        riskDetail.put("networkEnv", networkEnv);
        riskDetail.put("appSelfPortrait", appSelfPortrait);
        riskDetail.put("appAbnormal", appAbnormal);
        riskDetail.put("inputBehavior", inputBehavior);
        riskDetail.put("placeFocus", placeFocus);
        riskDetail.put("placeStable", placeStable);
        riskDetail.put("simulatorIdentify", simulatorIdentify);
        riskDetail.put("info1", info1);
        riskDetail.put("info2", info2);
        riskDetail.put("info3", info3);
        riskDetail.put("info4", info4);
        riskDetail.put("info5", info5);
        riskDetail.put("info6", info6);
        riskDetail.put("info7", info7);
        riskDetail.put("info8", info8);
        riskDetail.put("info9", info9);
        riskDetail.put("value1", value1);
        riskDetail.put("value2", value2);
        riskDetail.put("value3", value3);
        riskDetail.put("value4", value4);
        riskDetail.put("value5", value5);
        riskDetail.put("value6", value6);
        riskDetail.put("value7", value7);
        riskDetail.put("value8", value8);
        riskDetail.put("value9", value9);
        riskDetail.put("value10", value10);
        riskDetail.put("value11", value11);
        riskDetail.put("value12", value12);
        riskDetail.put("value13", value13);
        riskDetail.put("value14", value14);
        riskDetail.put("value15", value15);
        riskDetail.put("value16", value16);
        riskDetail.put("value17", value17);
        riskDetail.put("value18", value18);
        riskDetail.put("value19", value19);
        riskDetail.put("value20", value20);
        riskDetail.put("value21", value21);
        riskDetail.put("value22", value22);
        riskDetail.put("value23", value23);
        riskDetail.put("value24", value24);
        riskDetail.put("value25", value25);
        riskDetail.put("value26", value26);
        riskDetail.put("value27", value27);
        riskDetail.put("value28", value28);
        riskDetail.put("value29", value29);
        riskDetail.put("value30", value30);
        map.put("entryRules",entryRules);
        map.put("riskDetail",riskDetail);

        return JSONUtil.convertJson(map);
    }

    @Override
    public String toString() {
        return "RiskOutputVO{" +
                "orderId='" + orderId + '\'' +
                ", riskJob='" + riskJob + '\'' +
                ", telBlackList='" + telBlackList + '\'' +
                ", gpsDistance='" + gpsDistance + '\'' +
                ", telProvince='" + telProvince + '\'' +
                ", telCity='" + telCity + '\'' +
                ", gpsProvince='" + gpsProvince + '\'' +
                ", gpsCity='" + gpsCity + '\'' +
                ", isPlaceAllowed='" + isPlaceAllowed + '\'' +
                ", socialInfo='" + socialInfo + '\'' +
                ", socialAssociate='" + socialAssociate + '\'' +
                ", deviceAssociate='" + deviceAssociate + '\'' +
                ", isEduLevelChecked='" + isEduLevelChecked + '\'' +
                ", networkEnv='" + networkEnv + '\'' +
                ", appSelfPortrait='" + appSelfPortrait + '\'' +
                ", appAbnormal='" + appAbnormal + '\'' +
                ", inputBehavior='" + inputBehavior + '\'' +
                ", placeFocus='" + placeFocus + '\'' +
                ", placeStable='" + placeStable + '\'' +
                ", simulatorIdentify='" + simulatorIdentify + '\'' +
                ", info1='" + info1 + '\'' +
                ", info2='" + info2 + '\'' +
                ", info3='" + info3 + '\'' +
                ", info4='" + info4 + '\'' +
                ", info5='" + info5 + '\'' +
                ", info6='" + info6 + '\'' +
                ", info7='" + info7 + '\'' +
                ", info8='" + info8 + '\'' +
                ", info9='" + info9 + '\'' +
                ", riskScore=" + riskScore +
                ", value1='" + value1 + '\'' +
                ", value2='" + value2 + '\'' +
                ", value3='" + value3 + '\'' +
                ", value4='" + value4 + '\'' +
                ", value5='" + value5 + '\'' +
                ", value6='" + value6 + '\'' +
                ", value7='" + value7 + '\'' +
                ", value8='" + value8 + '\'' +
                ", value9='" + value9 + '\'' +
                ", value10='" + value10 + '\'' +
                ", value11='" + value11 + '\'' +
                ", value12='" + value12 + '\'' +
                ", value13='" + value13 + '\'' +
                ", value14='" + value14 + '\'' +
                ", value15='" + value15 + '\'' +
                ", value16='" + value16 + '\'' +
                ", value17='" + value17 + '\'' +
                ", value18='" + value18 + '\'' +
                ", value19='" + value19 + '\'' +
                ", value20='" + value20 + '\'' +
                ", value21='" + value21 + '\'' +
                ", value22='" + value22 + '\'' +
                ", value23='" + value23 + '\'' +
                ", value24='" + value24 + '\'' +
                ", value25='" + value25 + '\'' +
                ", value26='" + value26 + '\'' +
                ", value27='" + value27 + '\'' +
                ", value28='" + value28 + '\'' +
                ", value29='" + value29 + '\'' +
                ", value30='" + value30 + '\'' +
                '}';
    }
}
